package com.gopay.common.cps.dao.autosettle.impl;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.autosettle.AsBankSettleDailyStatsDao;
import com.gopay.common.domain.autosettle.AsBankSettleDailyStats;

/** 
 * @fileName  AsBankSettleDailyStatsDaoImpl.java
 * @author  张建龙 
 * @date 创建时间：2016年1月19日 上午11:34:45
 */
@Repository(value="asBankSettleDailyStatsDao")
public class AsBankSettleDailyStatsDaoImpl extends BaseDAOImpl<AsBankSettleDailyStats, Serializable> implements AsBankSettleDailyStatsDao{

	@Override
	public List<AsBankSettleDailyStats> getAsBankSettleDailyStats(Date beginDate, Date endDate) {
		DetachedCriteria criteria = DetachedCriteria.forClass(AsBankSettleDailyStats.class);
		criteria.add(Restrictions.between("settleDate", beginDate, endDate));
		return (List<AsBankSettleDailyStats>)this.findByCriteria(criteria);
	}

	@Override
	public List<AsBankSettleDailyStats> getAsBankSettleDailyStats(Date beginDate, Date endDate, String bankCode) {
		DetachedCriteria criteria = DetachedCriteria.forClass(AsBankSettleDailyStats.class);
		criteria.add(Restrictions.between("settleDate", beginDate, endDate));
		criteria.add(Restrictions.eq("bankCode", bankCode));
		return (List<AsBankSettleDailyStats>)this.findByCriteria(criteria);
	}
	
}
